// Copyright (c) 2012 NetPipe
// All Rights Reserved.

/**
 * @file AnalyseContents.h
 * 目录页分析
 * @author fanpc
 * @date 2012/07/25
 * @version 1.0
 * @note Create
 * Date		     Ver	     Name	   Description
 * 20120725		 1.1.0		 fanpc	   create
 */
#ifndef NP_ANALYSER_ANALYSECONTENTS_H
#define NP_ANALYSER_ANALYSECONTENTS_H
#include <vector>
#include <config/Structures.h>
#include "AnalyseBase.h"

#define SIZE_BOOKREADER 10000

class AnalyseContents:public AnalyseBase
{
public:
    AnalyseContents();

    /**
      * 获取卷/章节列表
      */
    void analyseVolumeList();

     inline int getSize() const
     { return m_bookReaderIndex; }

    chapterInfo::ChapterInfo& operator [](int index) ;

     void setChapterID(int index, int id);

//     void setChapterType(int index, char ctype);

private:
    chapterInfo::ChapterInfo m_bookreader[SIZE_BOOKREADER];

    int m_bookReaderIndex;    /*<数组当前索引>*/

    int m_chapterID;

    void splitVolumeHtml(std::vector<std::string>& volumes);

    void analyseVolume(const std::string& volumeString);

    void analyseChapterList(const std::string& volumeString, const  chapterInfo::ChapterInfo& volume);
};

#endif // NP_ANALYSER_ANALYSECONTENTS_H
